
//对p取模的快速幂，(a ^ power) % mod
long long QuickPower(int a, int power, int mod)
{
    long long base = a;
    long long ans = 1;
    while ( power > 0 )
    {
        if(power & 0x01)
        {
            ans = (ans * base) % mod;
        }
        power >>= 1;
        base = (base * base) % mod;
    }
    return ans;
}